package org.jeecg.modules.workflow.service.change.listener;

import org.jeecg.modules.workflow.framework.core.event.BpmProcessInstanceResultEvent;
import org.jeecg.modules.workflow.framework.core.event.BpmProcessInstanceResultEventListener;
import org.jeecg.modules.workflow.service.change.BpmChgProtocolService;
import org.jeecg.modules.workflow.service.change.imp.BpmChgProtocolServiceImpl;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author : Wzz
 * @create : 2023-04- 27- 10:09
 * @desc :
 */
@Component
public class BpmChgProtocolResultListener extends BpmProcessInstanceResultEventListener {

    @Resource
    private BpmChgProtocolService chgProtocolService;

    @Override
    protected String getProcessDefinitionKey() {
        return BpmChgProtocolServiceImpl.PROCESS_KEY;
    }

    @Override
    protected void onEvent(BpmProcessInstanceResultEvent event) {
        chgProtocolService.updateChgProtocolResult(event.getBusinessKey(), event.getResult());
    }
}
